<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>笔记列表</title>
</head>
<body>
    {{ request.session.user_info.username }} 的笔记
    <a href="/note/add">添加新笔记</a> <a href="#">返回首页</a>

    <hr>
    <a href="/note/make_page_csv?page={{ c_page.number }}">生成csv</a>

    <table border="1">
        <tr>
            <th>ID</th>
            <th>标题</th>
            <th>创建时间</th>
            <th>修改时间</th>
            <th>修改 删除</th>
        </tr>
        {% for note in c_page %}
        <tr>
            <td>{{ note.id }}</td>
            <td>{{ note.title }}</td>
            <td>{{ note.create_time }}</td>
            <td>{{ note.updated_time }}</td>
            <td>修改 删除</td>
        </tr>
        {% endfor %}
    </table>
<hr>

    <!--上一页-->
    {% if c_page.has_previous %}
        <a href="/note/test_page?page={{ c_page.previous_page_number }}">上一页</a>
        {% else %}
        上一页
    {% endif %}

    {% for p_num in paginator.page_range %}
        {% if p_num == c_page.number %}
            {{ p_num }}
            {% else %}
            <a href="/note/all?page={{ p_num }}">{{ p_num }}</a>
        {% endif %}
    {% endfor %}

    {% if c_page.has_next %}
        <a href="/note/all?page={{ c_page.next_page_number }}">下一页</a>
    {% else %}
        下一页
    {% endif %}
</body>
</html>